﻿class  CHostPoint
{
	var label:String;
	var Caption:String;
	var Action:String;
	var Top,Left:Number;
	public function CHostPoint(_Caption:String,_Action,_Left:Number,_Top:Number)
	{
		var iR:Number = randRange(0,50);
		if(_Caption)
		{
			Caption = _Caption;
		}else
		{
			Caption = "缺省热点"+iR;
		}
		if(_Caption)
		{
			label = _Caption;
		}else
		{
			label = "缺省热点"+iR;
		}
		
		if(_Action)
		{
			Action = _Action;
		}else
		{
			Action = "Index."+iR;
		}
		
		if(_Left&&_Top)
		{
			Left = _Left;
			Top = _Top;
		}else
		{
			var __Left:Number = randRange(200,1000);
			var __Top:Number = randRange(200, 800);
			Left = __Left;
			Top = __Top;
		}
	}
	public function setPosition(_Left:Number,_Top:Number):Void
	{
		Top = _Top;
		Left = _Left;
	}
	public function getTop():Number
	{
		return Top;
	}
	public function getLeft():Number
	{
		return Left;
	}
	public function setCaption(value:String):Void
	{
		Caption=value;
	}
	public function setAction(value:String):Void
	{
		Action = value;
	}
	public function getCaption():String
	{
		return Caption;
	}
	public function getAction():String
	{
		return Action;
	}
	private function randRange(min:Number, max:Number):Number 
	{
    	var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
    	return randomNum;
	}

};
